<?php
namespace util\validate;


/**
 * Created by PhpStorm.
 * User: kb130
 * Date: 2017/8/18
 * Time: 14:56
 */
class Rule
{
    const VALIDATE_NAMESPACE = 'util\validate\rules\\';

    private function __construct() {}

    public static function __callStatic($name, $args) {
        $name = ucfirst($name);
        $className = static::VALIDATE_NAMESPACE . $name;

        return 2 === count($args) ?
            new $className($args[0], $args[1]) :
            new $className($args[0]);
    }
}